class LyLoginModel {
  LyLoginModel({
    this.isFirstRegister,
    this.token,
    this.userInfo,
  });

  LyLoginModel.fromJson(dynamic json) {
    if (json is Map) {
      isFirstRegister = json['isFirstRegister'];
      token = json['token'];
      userInfo =
          json['userInfo'] != null ? UserInfo.fromJson(json['userInfo']) : null;
    }
  }
  bool? isFirstRegister;
  String? token;
  UserInfo? userInfo;
  LyLoginModel copyWith({
    bool? isFirstRegister,
    String? token,
    UserInfo? userInfo,
  }) =>
      LyLoginModel(
        isFirstRegister: isFirstRegister ?? this.isFirstRegister,
        token: token ?? this.token,
        userInfo: userInfo ?? this.userInfo,
      );
  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['isFirstRegister'] = isFirstRegister;
    map['token'] = token;
    if (userInfo != null) {
      map['userInfo'] = userInfo?.toJson();
    }
    return map;
  }
}

class UserInfo {
  UserInfo({
    this.age,
    this.auditStatus,
    this.availableCoins,
    this.avatar,
    this.avatarMiddleThumbUrl,
    this.avatarThumbUrl,
    this.avatarUrl,
    this.birthday,
    this.country,
    this.createTime,
    this.followNum,
    this.gender,
    this.giftWallAction,
    this.hasEquity,
    this.isAnswer,
    this.isBlock,
    this.isHavePassword,
    this.isInternal,
    this.isMultiple,
    this.isRecharge,
    this.isReview,
    this.isSwitchNotDisturbCall,
    this.isSwitchNotDisturbIm,
    this.isVip,
    this.level,
    this.loginPkgName,
    this.nickname,
    this.praiseNum,
    this.registerCountry,
    this.registerPkgName,
    this.rongcloudToken,
    this.tagDetails,
    this.tagsList,
    this.userId,
    this.userType,
  });

  UserInfo.fromJson(dynamic json) {
    age = json['age'];
    auditStatus = json['auditStatus'];
    availableCoins = json['availableCoins'];
    avatar = json['avatar'];
    avatarMiddleThumbUrl = json['avatarMiddleThumbUrl'];
    avatarThumbUrl = json['avatarThumbUrl'];
    avatarUrl = json['avatarUrl'];
    birthday = json['birthday'];
    country = json['country'];
    createTime = json['createTime'];
    followNum = json['followNum'];
    gender = json['gender'];
    giftWallAction = json['giftWallAction'];
    hasEquity = json['hasEquity'];
    isAnswer = json['isAnswer'];
    isBlock = json['isBlock'];
    isHavePassword = json['isHavePassword'];
    isInternal = json['isInternal'];
    isMultiple = json['isMultiple'];
    isRecharge = json['isRecharge'];
    isReview = json['isReview'];
    isSwitchNotDisturbCall = json['isSwitchNotDisturbCall'];
    isSwitchNotDisturbIm = json['isSwitchNotDisturbIm'];
    isVip = json['isVip'];
    level = json['level'];
    loginPkgName = json['loginPkgName'];
    nickname = json['nickname'];
    praiseNum = json['praiseNum'];
    registerCountry = json['registerCountry'];
    registerPkgName = json['registerPkgName'];
    rongcloudToken = json['rongcloudToken'];
    if (json['tagDetails'] != null) {
      tagDetails = [];
      json['tagDetails'].forEach((v) {
        tagDetails?.add(TagDetails.fromJson(v));
      });
    }
    tagsList = json['tagsList'] != null ? json['tagsList'].cast<String>() : [];
    userId = json['userId'];
    userType = json['userType'];
  }
  num? age;
  num? auditStatus;
  num? availableCoins;
  String? avatar;
  String? avatarMiddleThumbUrl;
  String? avatarThumbUrl;
  String? avatarUrl;
  String? birthday;
  String? country;
  dynamic createTime;
  num? followNum;
  num? gender;
  num? giftWallAction;
  bool? hasEquity;
  bool? isAnswer;
  bool? isBlock;
  bool? isHavePassword;
  bool? isInternal;
  bool? isMultiple;
  bool? isRecharge;
  bool? isReview;
  bool? isSwitchNotDisturbCall;
  bool? isSwitchNotDisturbIm;
  bool? isVip;
  num? level;
  String? loginPkgName;
  String? nickname;
  num? praiseNum;
  String? registerCountry;
  String? registerPkgName;
  String? rongcloudToken;
  List<TagDetails>? tagDetails;
  List<String>? tagsList;
  String? userId;
  num? userType;
  UserInfo copyWith({
    num? age,
    num? auditStatus,
    num? availableCoins,
    String? avatar,
    String? avatarMiddleThumbUrl,
    String? avatarThumbUrl,
    String? avatarUrl,
    String? birthday,
    String? country,
    num? createTime,
    num? followNum,
    num? gender,
    num? giftWallAction,
    bool? hasEquity,
    bool? isAnswer,
    bool? isBlock,
    bool? isHavePassword,
    bool? isInternal,
    bool? isMultiple,
    bool? isRecharge,
    bool? isReview,
    bool? isSwitchNotDisturbCall,
    bool? isSwitchNotDisturbIm,
    bool? isVip,
    num? level,
    String? loginPkgName,
    String? nickname,
    num? praiseNum,
    String? registerCountry,
    String? registerPkgName,
    String? rongcloudToken,
    List<TagDetails>? tagDetails,
    List<String>? tagsList,
    String? userId,
    num? userType,
  }) =>
      UserInfo(
        age: age ?? this.age,
        auditStatus: auditStatus ?? this.auditStatus,
        availableCoins: availableCoins ?? this.availableCoins,
        avatar: avatar ?? this.avatar,
        avatarMiddleThumbUrl: avatarMiddleThumbUrl ?? this.avatarMiddleThumbUrl,
        avatarThumbUrl: avatarThumbUrl ?? this.avatarThumbUrl,
        avatarUrl: avatarUrl ?? this.avatarUrl,
        birthday: birthday ?? this.birthday,
        country: country ?? this.country,
        createTime: createTime ?? this.createTime,
        followNum: followNum ?? this.followNum,
        gender: gender ?? this.gender,
        giftWallAction: giftWallAction ?? this.giftWallAction,
        hasEquity: hasEquity ?? this.hasEquity,
        isAnswer: isAnswer ?? this.isAnswer,
        isBlock: isBlock ?? this.isBlock,
        isHavePassword: isHavePassword ?? this.isHavePassword,
        isInternal: isInternal ?? this.isInternal,
        isMultiple: isMultiple ?? this.isMultiple,
        isRecharge: isRecharge ?? this.isRecharge,
        isReview: isReview ?? this.isReview,
        isSwitchNotDisturbCall:
            isSwitchNotDisturbCall ?? this.isSwitchNotDisturbCall,
        isSwitchNotDisturbIm: isSwitchNotDisturbIm ?? this.isSwitchNotDisturbIm,
        isVip: isVip ?? this.isVip,
        level: level ?? this.level,
        loginPkgName: loginPkgName ?? this.loginPkgName,
        nickname: nickname ?? this.nickname,
        praiseNum: praiseNum ?? this.praiseNum,
        registerCountry: registerCountry ?? this.registerCountry,
        registerPkgName: registerPkgName ?? this.registerPkgName,
        rongcloudToken: rongcloudToken ?? this.rongcloudToken,
        tagDetails: tagDetails ?? this.tagDetails,
        tagsList: tagsList ?? this.tagsList,
        userId: userId ?? this.userId,
        userType: userType ?? this.userType,
      );
  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['age'] = age;
    map['auditStatus'] = auditStatus;
    map['availableCoins'] = availableCoins;
    map['avatar'] = avatar;
    map['avatarMiddleThumbUrl'] = avatarMiddleThumbUrl;
    map['avatarThumbUrl'] = avatarThumbUrl;
    map['avatarUrl'] = avatarUrl;
    map['birthday'] = birthday;
    map['country'] = country;
    map['createTime'] = createTime;
    map['followNum'] = followNum;
    map['gender'] = gender;
    map['giftWallAction'] = giftWallAction;
    map['hasEquity'] = hasEquity;
    map['isAnswer'] = isAnswer;
    map['isBlock'] = isBlock;
    map['isHavePassword'] = isHavePassword;
    map['isInternal'] = isInternal;
    map['isMultiple'] = isMultiple;
    map['isRecharge'] = isRecharge;
    map['isReview'] = isReview;
    map['isSwitchNotDisturbCall'] = isSwitchNotDisturbCall;
    map['isSwitchNotDisturbIm'] = isSwitchNotDisturbIm;
    map['isVip'] = isVip;
    map['level'] = level;
    map['loginPkgName'] = loginPkgName;
    map['nickname'] = nickname;
    map['praiseNum'] = praiseNum;
    map['registerCountry'] = registerCountry;
    map['registerPkgName'] = registerPkgName;
    map['rongcloudToken'] = rongcloudToken;
    if (tagDetails != null) {
      map['tagDetails'] = tagDetails?.map((v) => v.toJson()).toList();
    }
    map['tagsList'] = tagsList;
    map['userId'] = userId;
    map['userType'] = userType;
    return map;
  }
}

class TagDetails {
  TagDetails({
    this.tag,
    this.tagColor,
    this.tagTip,
  });

  TagDetails.fromJson(dynamic json) {
    tag = json['tag'];
    tagColor = json['tagColor'];
    tagTip = json['tagTip'];
  }
  String? tag;
  String? tagColor;
  String? tagTip;
  TagDetails copyWith({
    String? tag,
    String? tagColor,
    String? tagTip,
  }) =>
      TagDetails(
        tag: tag ?? this.tag,
        tagColor: tagColor ?? this.tagColor,
        tagTip: tagTip ?? this.tagTip,
      );
  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['tag'] = tag;
    map['tagColor'] = tagColor;
    map['tagTip'] = tagTip;
    return map;
  }
}
